<template>
  <div>
    <el-tabs  v-model="activeName" type="border-card"  @tab-click="tabclick">
      <el-tab-pane name="one" label="门店商品">
          <goods_list :isComponent="'true'" :merchantIdProp="merchant_id" />
      </el-tab-pane>
      <el-tab-pane  name="two" label="商品分类">
          <shopSort :merchantIdProp="merchant_id" ref="shopSort"></shopSort>
      </el-tab-pane>
      <el-tab-pane  name="three" label="门店员工">
          <storeStaff :merchantIdProp="merchant_id" ref="storeStaff"></storeStaff>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import shopSort from "../shopSort.vue"
  import storeStaff from "../storeStaff.vue"
  import goods_list from "@/views/shopManage/goods_list";
  export default {
    props: {
      merchant_id: ''
    },
    watch: {
      merchant_id() {

      }
    },
    data() {
      return {
        activeName:"one"
      }
    },
    components: {
      shopSort,
      storeStaff,
      goods_list
    },
    mounted() {
     let getActiveName = window.localStorage.getItem("activeName")
      if(getActiveName != undefined){
         this.activeName = getActiveName
      }
    },
    methods: {
        tabclick(e){
            if(e.index==0){
            } else if(e.index==1){
              this.$refs.shopSort.getGoodsClassifyList()
            }else if(e.index==2){
              this.$refs.storeStaff.getMerchantStaffList()
              this.$refs.storeStaff.roleList()
            }
            window.localStorage.setItem("activeName",this.activeName)
        }

    }
  }
</script>
<style scoped="scoped">

</style>
